package customview.ike.com.customviewproject.utils.recycleViewCommonUtils.MultiItemAdapter;

import android.databinding.ViewDataBinding;

/**
 * Created by ike on 2017/9/15.
 */

public abstract class ItemViewDelegate<T,M extends ViewDataBinding> {
    /**
     * 对应布局的dataBinding
     */
    public  M bind;
    /**
     * 条目的布局id
     * @return
     */
    public abstract  int getItemViewLayoutId();

    /**
     * 是否是正确的条目类型，应对多条目类型的展示
     * @param item
     * @param position
     * @return
     */
    public abstract boolean isRightViewType(T item,int position);

    /**
     * 填充数据
     * @param viewHolder
     * @param item
     * @param position
     */
    public abstract void convert(MultiItemTypeAdapter.ViewHolder viewHolder, T item, int position);
    
}
